10 REM STEPHEN GIBBONS    34 THE COMENARRA    PKY, THORNLEIGH    N.S.W. 2120
20 CLS
30 PRINT:PRINT"            dogfight"
35 SOUND89,1:SOUND125,1:SOUND147,1:SOUND176,7
40 PRINT:PRINT
50 PRINT"        BY S.GIBBONS '83"
55 SOUND218,2:SOUND218,9
60 PRINT
70 INPUT"LEFT PLAYER'S NAME";LP$:PRINT:INPUT"RIGHT PLAYER'S NAME";RP$
80 PRINT
100 PRINT:PRINT"DO YOU NEED INSTRUCTIONS (Y/N)?";
150 I$=INKEY$:IFI$=""THEN150
160 IFI$="Y"THENGOSUB2060
170 CLS0
180 X=RND(31)+15:A=RND(31)+15:Y=RND(15)+7:B=RND(15)+7
190 M=RND(7)+23:FORN=MTO31:SET(0,N,5):NEXT
200 FORN=1TO63
210 ND=RND(2):ONNDGOSUB260,280
220 SET(N,M,5):SET(N-1,M,5):NEXT
230 FORN=MTO31:SET(63,N,5):NEXT
240 FORN=0TO63:SET(N,31,5):NEXT
250 GOTO300
260 IFM<23THENM=M+1:RETURN
270 M=M-1:RETURN
280 IFM>30THENM=M-1:RETURN
290 M=M+1:RETURN
300 I$=INKEY$
310 IFX=AANDY=BTHEN1420
320 IFI$="2"THEN1510
350 IFP3=1THEN440
360 IFI$="Q"THENAD=AD-1:IFAD<1THENAD=8
370 IFI$="W"THENAD=AD+1:IFAD>8THENAD=1
410 IFI$="0"THENGOSUB1870
440 IFP2<>1THEN490
450 IFP2=1THENW=RND(2):ONWGOTO460,470
460 BD=6:GOTO480
470 BD=4
480 IFP2=1THEN550
490 IFI$="O"THENBD=BD-1:IFBD<1THENBD=8
500 IFI$="P"THENBD=BD+1:IFBD>8THENBD=1
540 IFP3=1THENQ=RND(2):ONQGOTO560,570
550 GOTO580
560 AD=4:GOTO580
570 AD=6
580 ONADGOSUB670,690,710,730,750,770,790,810
590 IFX>61THENRESET(61,Y):RESET(61,Y-1):RESET(61,Y+1):X=3
600 IFX<3THENRESET(X+1,Y):RESET(X+1,Y+1):RESET(X+1,Y-1):X=61
610 IFY<2THENY=2
620 SET(X,Y,3)
630 IFP3=1THEN1300
640 RESET(X-1,Y):RESET(X+1,Y):RESET(X,Y+1):RESET(X,Y-1):RESET(X-1,Y-1):RESET(X+1,Y-1):RESET(X-1,Y+1):RESET(X+1,Y+1)
650 GOTO1300
660 Y=Y-1:RETURN
670 IFPOINT(X,Y-2)=5THEN830
680 Y=Y-1:RETURN
690 IFPOINT(X+2,Y-2)=5THEN830
700 X=X+1:Y=Y-1:RETURN
710 IFPOINT(X+2,Y+2)=5THEN830
720 X=X+1:RETURN
730 IFPOINT(X+1,Y+2)=5THEN830
740 X=X+1:Y=Y+1:RETURN
750 IFPOINT(X,Y+2)=5THEN830
760 Y=Y+1:RETURN
770 IFPOINT(X-1,Y+2)=5THEN830
780 X=X-1:Y=Y+1:RETURN
790 IFPOINT(X+2,Y+2)=5THEN830
800 X=X-1:RETURN
810 IFPOINT(X-2,Y-2)=5THEN830
820 X=X-1:Y=Y-1:RETURN
830 FORZ=1TO5:SOUNDRND(5)+250,1:NEXT
835 PRINT@10,RP$;" WINS";
840 FORZ=1TO25
850 P3=0
860 C=RND(8)
870 SET(X,Y+2,C):SET(X-1,Y-1,C):SET(X+1,Y-2,C)
880 SET(X+2,Y-4,C):SET(X-2,Y-5,C)
890 RESET(X,Y)
900 SET(X,Y+1,C)
910 NEXT
920 SC=SC+1:GOTO1191
930 RESET(X,Y+1):RESET(X+1,Y-2):RESET(X-1,Y-1):RESET(X,Y-3):RESET(X-2,Y-5)
940 AD=0:BD=0:GOTO140
960 IFPOINT(A,B-2)=5THEN1120
970 B=B-1:RETURN
980 IFPOINT(A+2,B-2)=5THEN1120
990 A=A+1:B=B-1:RETURN
1000 IFPOINT(A+2,B+2)=5THEN1120
1010 A=A+1:RETURN
1020 IFPOINT(A+1,B+2)=5THEN1120
1030 A=A+1:B=B+1:RETURN
1040 IFPOINT(A,B+2)=5THEN 1120
1050 B=B+1:RETURN
1060 IFPOINT(A-2,B)=5ORPOINT(A,B+2)=5THEN1120
1070 A=A-1:B=B+1:RETURN
1080 IFPOINT(A-2,B+2)=5THEN1120
1090 A=A-1:RETURN
1100 IFPOINT(A-2,B-2)=5THEN1120
1110 A=A-1:B=B-1:RETURN
1120 FORZ=1TO5:SOUNDRND(5)+250,1:NEXT
1125 PRINT@10,LP$;" WINS";
1130 FORZ=1TO25
1140 C=RND(8)
1150 SET(A,B+1,U):SET(A+1,B-2,C):SET(A-2,B-3,C):SET(A+3,B-4,C)
1160 SET(A,B-1,C)
1170 SET(A-1,B-5,C)
1180 RESET(A,B)
1190 NEXT:P2=0:SD=SD+1
1191 SOUND133,7:SOUND133,7:SOUND133,2:SOUND133,7
1192 SOUND153,7:SOUND147,2:SOUND147,7
1193 SOUND133,2:SOUND133,7:SOUND125,2:SOUND133,9
1220 CLS:PRINT"             scores"
1230 PRINT:PRINT:PRINT
1240 PRINTTAB(5)LP$;TAB(20)SD:PRINT:PRINTTAB(5)RP$;TAB(20)SC
1250 FORD=1TO1000:NEXT
1260 IFSC>9ORSD>9THEN1950
1270 AD=0:BD=0
1280 CLS0
1290 GOTO170
1300 REM
1310 ONBDGOSUB960,980,1000,1020,1040,1060,1080,1100
1320 IFA>61THENRESET(61,B):RESET(61,B-1):RESET(61,B+1):A=3
1330 IFA<3THENRESET(A+1,B):RESET(A+1,B+1):RESET(A+1,B-1):A=61
1340 IFB<3THENC=RND(2):ONCGOTO1370,1360
1350 GOTO1380
1360 B=3:BD=7:GOTO1380
1370 B=3:BD=3:GOTO1380
1380 SET(A,B,4)
1390 IFP2=1THEN300
1400 RESET(A+1,B):RESET(A-1,B):RESET(A,B-1):RESET(A,B+1):RESET(A+1,B-1):RESET(A-1,B-1):RESET(A+1,B+1):RESET(A-1,B+1)
1410 GOTO300
1420 FORZ=1TO7:SOUNDRND(5)+250,1:NEXT
1425 PRINT@9,"YOU BOTH LOSE";
1430 FORZ=1TO25
1440 C=RND(8)
1450 SET(X-2,Y+2,C):SET(X+1,Y+4,C):SET(X+2,Y-3,C):SET(X-1,Y-2,C)
1460 SET(X+1,Y+2,C)
1470 SET(X+3,Y,C)
1480 NEXT
1490 SC=SC+1:SD=SD+1
1500 AD=0:BD=0:GOTO1191
1510 M=X:N=Y
1520 K=0
1530 ONADGOSUB1560,1580,1600,1620,1640,1660,1680,1700
1540 GOTO1720
1550 RETURN
1560 IFPOINT(M,N-2)=5THEN1820
1570 N=N-1:RETURN
1580 IFPOINT(M+2,N-2)=5THEN1820
1590 N=N-1:M=M+1:RETURN
1600 IFPOINT(M+2,N)=5THEN1820
1610 M=M+1:RETURN
1620 IFPOINT(M+2,N+2)=5THEN1820
1630 M=M+1:N=N+1:RETURN
1640 IFPOINT(M,N+2)=5THEN1820
1650 N=N+1:RETURN
1660 IFPOINT(M-2,N+2)=5THEN1820
1670 N=N+1:M=M-1:RETURN
1680 IFPOINT(M-2,N)=5THEN1820
1690 M=M-1:RETURN
1700 IFPOINT(M-2,N-2)=5THEN1820
1710 M=M-1:N=N-1:RETURN
1720 IFPOINT(M,N-1)=4ORPOINT(M,N+1)=4ORPOINT(M+1,N)=4ORPOINT(M-1,N)=4THENP2=1
1730 IFPOINT(M-1,N-1)=4ORPOINT(M-1,N+1)=4ORPOINT(M+1,N-1)=4ORPOINT(M+1,N+1)=4THENP2=1
1740 K=K+1:IFK>5THENK=0:GOTO1820
1750 IFM<2ORM>60ORN<2THENK=0:GOTO1820
1760 SOUND243,1
1770 SET(M,N,2):SET(X,Y,3):SET(A,B,4)
1780 RESET(M+1,N):RESET(M-1,N):RESET(M,N+1):RESET(M,N-1)
1790 RESET(M-1,N+1):RESET(M+1,N+1):RESET(M-1,N-1):RESET(M+1,N-1)
1800 IFGH=1THEN1890
1810 GOTO1530
1820 RESET(M,N)
1830 RESET(M-1,N):RESET(M+1,N):RESET(M,N-1):RESET(M,N+1)
1840 RESET(M-1,N-1):RESET(M-1,N+1):RESET(M+1,N-1):RESET(M+1,N+1)
1850 GH=0
1860 GOTO300
1870 M=A:N=B
1880 K=0:GH=1
1890 ONBDGOSUB1560,1580,1600,1620,1640,1660,1680,1700
1900 GOTO1920
1910 RETURN
1920 IFPOINT(M,N-1)=3ORPOINT(M,N+1)=3ORPOINT(M+1,N)=3ORPOINT(M-1,N)=3THENP3=1
1930 IFPOINT(M-1,N-1)=3ORPOINT(M-1,N+1)=3ORPOINT(M+1,N-1)=3ORPOINT(M+1,N+1)=3THENP3=1
1940 GOTO1740
1950 CLS
1960 PRINT
1970 PRINT"           dogfight"
1980 PRINT:PRINT
1990 IFSC>SDTHENCH$=RP$:LO$=LP$:GOTO2000
1991 CH$=LP$:LO$=RP$
2000 PRINTCH$;" IS THE BETTER BARON."
2010 PRINT"BETTER LUCK NEXT TIME ";LO$;"."
2011 SOUND89,2: SOUND89,2:SOUND89,2:SOUND125,2:SOUND89,2
2012 SOUND125,2:SOUND147,2:SOUND125,2:SOUND147,2:SOUND176,7
2013 FORZZ=1TO100:NEXT:SOUND176,2:SOUND176,7
2020 PRINT:PRINT
2030 PRINT"ANOTHER DOGFIGHT (Y/N)?"
2040 I$=INKEY$:IFI$=""THEN2040
2050 IFI$="Y"THENRUN
2051 IFI$="N"THENEND
2055 GOTO2040
2060 CLS:PRINT"           dogfight"
2070 PRINT
2080 PRINT"    DOGFIGHT IS A GAME FOR TWO  PLAYERS. THE RULES ARE SIMPLE.  SHOOT DOWN YOUR OPPONENT BEFORE HE SHOOTS YOU DOWN."
2090 PRINT"    THE WINNER IS THE PILOT WHO WINS TEN ROUNDS FIRST."
2100 PRINT"    IF YOU CRASH INTO THE       MOUNTAINS YOU WILL EXPLODE.     IF YOU CRASH INTO YOUR OPPONENT,";
2101 PRINT"YOU BOTH WILL EXPLODE."
2110 PRINT:PRINT"HIT ANY KEY TO CONTINUE."
2120 I$=INKEY$:IFI$=""THEN2120
2130 CLS:PRINT"           dogfight"
2140 PRINT
2150 PRINTLP$;"'S CONTROLS ARE:"
2160 PRINT"<Q>  -TO ROTATE ANTICLOCKWISE"
2170 PRINT"<W>  -TO ROTATE CLOCKWISE"
2171 PRINT"<2>  -TO FIRE MACHINE GUNS"
2180 PRINTRP$;"'S CONTROLS ARE:"
2190 PRINT"<O>  -TO ROTATE LEFT
2191 PRINT"<P>  -TO ROTATE RIGHT"
2200 PRINT"<0>  -TO FIRE MACHINE GUNS"
2220 PRINT:PRINT"HIT ANY KEY TO CONTINUE";
2230 I$=INKEY$:IFI$=""THEN 2230
2240 RETURN
